home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1997 August / Macworld (1997-08).dmg / Serious Demos / Crimson Demo / Crimson Demos / Progress Bar / PBDemoMain < prev    next >
Text File  |  1997-06-17  |  2KB  |  72 lines

  1. *************************
  2. *                                              *
  3. *        Event - DecButton.DClick        *
  4. *************************
  5. Procedure PBDemo.DecButton.DClick()
  6.     Do PBDemo.DecButton.Click
  7. Return
  8.  
  9. *************************
  10. *                                              *
  11. *        Event - DecButton.Click         *
  12. *************************
  13. Procedure PBDemo.DecButton.Click()
  14.  
  15.     If BarPosition >0
  16.         * Reduce the position of the progress bar by 10%
  17.         Sub BarPosition,10
  18.         Do Draw_Bar
  19.     Endif
  20. Return
  21.  
  22. *************************
  23. *                                              *
  24. *        Event - IncButton.DClick        *
  25. *************************
  26. Procedure PBDemo.IncButton.DClick()
  27.     Do PBDemo.IncButton.Click
  28. Return
  29.  
  30. *************************
  31. *                                              *
  32. *        Event - IncButton.Click         *
  33. *************************
  34. Procedure PBDemo.IncButton.Click()
  35.  
  36.     If BarPosition <100
  37.         * Increase the position of the progress bar by 10%
  38.         Add BarPosition,10
  39.         Do Draw_Bar
  40.     Endif
  41. Return
  42.  
  43. *************************
  44. *                                              *
  45. *        Event - PBDemo.OnClose         *
  46. *************************
  47. Procedure PBDemo.OnClose()
  48.     PBDemo.CloseWindow
  49.     End
  50. Return
  51.  
  52. *************************
  53. *                                              *
  54. *        Procedure Draw_Bar              *
  55. *************************
  56. Procedure Draw_Bar() Public
  57. Local RectSize As Integer
  58. Local BarWidth As Integer
  59.  
  60.     * Calculate how wide the Container Rectangle is
  61.     RectSize=PBDemo.ContainerRect.Width-2
  62.  
  63.     * Calculate the new width of the progress bar
  64.     BarWidth=(RectSize*BarPosition)/100
  65.  
  66.     PBDemo.Bar.Width=BarWidth
  67. Return
  68.  
  69.  
  70.  
  71.  
  72.